package com.yeyks.consumer.dal.dao;

import com.yeyks.consumer.dal.domain.CashOutOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeyks.common.param.CashOutQueryParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 用户提现订单表 Mapper 接口
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface CashOutOrderMapper extends BaseMapper<CashOutOrder> {

    int deleteByPrimaryKey(Long id);

    int insertSelective(CashOutOrder record);

    CashOutOrder selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CashOutOrder record);

    int updateByPrimaryKey(CashOutOrder record);

    /**
     * 分页查询数据
     *
     * @param cashOutQueryParam
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<CashOutOrder> selectByPage(@Param(value = "cashOutQueryParam") CashOutQueryParam cashOutQueryParam,
                                    @Param(value = "pageNum") Integer pageNum,
                                    @Param(value = "pageSize") Integer pageSize);

    /**
     * 分页查询数据
     *
     * @param cashOutQueryParam
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<CashOutOrder> selectByPageV2(@Param(value = "cashOutQueryParam") CashOutQueryParam cashOutQueryParam,
                                    @Param(value = "pageNum") Integer pageNum,
                                    @Param(value = "pageSize") Integer pageSize);

    /**
     * 查询分页的个数
     *
     * @param cashOutQueryParam 输入参数
     * @return 返回行数
     */
    int selectByPageCountV2(@Param(value = "cashOutQueryParam") CashOutQueryParam cashOutQueryParam);
    CashOutOrder getNewestCashOutOrder(Integer userId);

}
